﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Cs2102BookingSystem.Models.BOOKING>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	BookingDetail
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:Panel ID="Panel2" runat="server" Height="61px" 
        style="font-size: xx-large; font-weight: 700; font-family: Calibri">
        <b>Booking Details - Admin</b></asp:Panel>

    <fieldset>
        <legend>Booking Information</legend>
        <table cellpadding="10px" style="border-spacing:10px">
            <tr>
                <td><div class="display-label">Confirmation ID:</div></td>
                <td><div class="display-field"><%: Model.BOOKINGID %></div></td>
                <td colspan="2" rowspan="2"><% Html.RenderAction("HotelImage", "Booking", new { HOTEL_NAME = Model.H_NAME, BRANCHNAME = Model.H_BRANCHNAME, COUNTRY = Model.H_COUNTRY}); %></td>
            </tr>
            <tr>
                <td><div class="display-label">Client Email:</div></td>
                <td><div class="display-field"><%: Model.C_EMAIL %></div></td>
            </tr>

            <tr>
                <td><div class="display-label">Hotel Name:</div></td>
                <td><div class="display-field"><%: Model.H_NAME %></div></td>
            </tr>
            <tr>
                <td><div class="display-label">Country:</div></td>
                <td><div class="display-field"><%: Model.H_COUNTRY %></div></td>
            </tr>
            <tr>
                <td><div class="display-label">Hotel Branch:</div></td>
                <td><div class="display-field"><%: Model.H_BRANCHNAME %></div></td>
            </tr>
            <tr>
                <td><div class="display-label">Room Type:</div></td>
                <td><div class="display-field"><%: Model.R_ROOMTYPE %> with<br />
                    <%: Model.R_BEDTYPE %></div></td>
            </tr>
            <tr>
                <td><div class="display-label">Number of Room Booked:</div></td>
                <td><div class="display-field"><%: Model.NOOFROOM %></div></td>
            </tr>
            <% var days = Model.ENDDATE.Date - Model.STARTDATE.Date ; %>
            
            <% var totalPrice = Model.NOOFROOM * Model.PRICEPERROOM * (Int16)days.TotalDays; %>
            <tr>
                <td><div class="display-label">Total Price Paid</div></td>
                <td><div class="display-field">$<%: String.Format("{0:F}", totalPrice) %></div></td>
            </tr>
            <tr>
                <td><div class="display-label">Arrival on:</div></td>
                <td><div class="display-field"><%: String.Format("{0:g}", Model.STARTDATE) %></div></td>
            </tr>
            <tr>
                <td><div class="display-label">Departure on</div></td>
                <td><div class="display-field"><%: String.Format("{0:g}", Model.ENDDATE) %></div></td>
            </tr>
        </table>
    </fieldset>
    <p>

        <%: Html.ActionLink("Edit", "EditBooking", new { id = Model.BOOKINGID })%> |
        <% Html.RenderPartial("DeleteBookingAdmin", Model); %> |
       
        <%: Html.ActionLink("Back to Main Page", "Index", "AdminMain")%> |
        
    </p>
 
</asp:Content>

